/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.google.code.jmarias.client.tcp;

import com.google.code.jmarias.client.phases.AbstractPhase;
import com.google.code.jmarias.common.action.ChooseDurchAction;
import com.google.code.jmarias.common.action.PickCardFromPeopleAction;
import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author Ondrej Michal &lt;ondrej.michal@netvoice.cz&gt;
 */
public class NewClass {

    private static Set<Class> classes = new HashSet<Class>();

    private static boolean check(Object action, Class clazz) {
        classes.add(clazz);
        return action == null ? false : clazz.isAssignableFrom(action.getClass());
    }

    public AbstractPhase processAction(Object action) {
        if (check(action, PickCardFromPeopleAction.class)) {
            System.out.println("a");
        } else if (check(action, ChooseDurchAction.class)) {
            System.out.println("b");
        }

        // rozdat 7, 5, 5
        // broadcast DealSevenCardsAction(forhont)
        // broadcast DealFiveCardsAction(left)
        // broadcast DealFiveCardsAction(right)

        // broadcast Token(forhont, {PickTrumpAction, ChooseFromPeopleAction})
        return null;
    }

    public static void main(String[] args) {
        new NewClass().processAction(null);
        new NewClass().processAction(null);
        System.out.println(NewClass.classes);
    }
}
